Imports RSToolKit.ReportService

Public Class frmDataSource

    Public ReadOnly Property DataSourceName() As String
        Get
            Return Me.txtName.Text
        End Get
    End Property

    Public ReadOnly Property Overwrite() As Boolean
        Get
            Return Me.cbOverwrite.Checked
        End Get
    End Property

    Public ReadOnly Property Hidden() As Boolean
        Get
            Return Me.cbHidden.Checked
        End Get
    End Property

    Public ReadOnly Property ConnectionString() As String
        Get
            Return "data source=" & Me.txtServer.Text & ";initial catalog=" & Me.txtDatenbank.Text
        End Get
    End Property

    Public ReadOnly Property Benutzername() As String
        Get
            Return Me.txtBenutzername.Text
        End Get
    End Property

    Public ReadOnly Property Password() As String
        Get
            Return Me.txtPWD.Text
        End Get
    End Property

    Public ReadOnly Property WindowsAuthentication() As Boolean
        Get
            Return Me.cbWindows.Checked
        End Get
    End Property

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.DialogResult = Windows.Forms.DialogResult.Cancel
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        Me.DialogResult = Windows.Forms.DialogResult.OK
    End Sub

    Private Sub cbWindows_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbWindows.CheckedChanged
        Me.txtBenutzername.Enabled = Not Me.cbWindows.Checked
        Me.txtPWD.Enabled = Not Me.cbWindows.Checked
    End Sub

    Private Sub frmDataSource_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txtName.Select()
    End Sub
End Class